package libsys.listeners;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JFrame;
import libsys.general.LIBSYSSystem;
import libsys.gui.MyFrame;
import libsys.gui.items.CalculatorFrameItems;
import libsys.gui.items.SettingsFrameItems;

public class MainMenuBarListener implements ActionListener
{
		LIBSYSSystem LibrarySystem;
		
		public MainMenuBarListener(LIBSYSSystem LibrarySystem)
		{
				this.LibrarySystem = LibrarySystem;
		}
		
		public void actionPerformed(ActionEvent ae)
		{
				if(ae.getActionCommand().equals("Calculator"))
				{
						launchCalculator();
				}
				
				else if(ae.getActionCommand().equals("Settings"))
				{
						launchSettings();
				}
		}
		
		private void launchSettings()
		{
				LibrarySystem.FrameList.SettingsFrame.setVisible(true);		
		}	
		
		private void launchCalculator()
		{
				LibrarySystem.FrameList.CalculatorFrame.setVisible(true);
		}		
}